<!doctype html>
<html>
<head>
<include file="public:headtop" />
    <link href="/static/css/general.css" rel="stylesheet">
<link href="/static/css/center.css" rel="stylesheet">
</head>

<body>
	<include file="public:headmini1" />
    <div class="order-box">
    	<div class="order ope">我的购物车</div>

        <div class="media-list" style="margin-top: 15px;">
            <volist name="item_orders" id="vo">
                <div class="media">
                    <a href="{: U('Item/index', array('id' => $vo['gid']))}">
                        <h3 class="media-title text-tract">{$vo.goods}</h3>
                    </a>
                    <span class="media-text">
                        <span class="media-text-item">数量：2</span>
                        <span class="media-text-item">单价：￥{$vo.price}</span>
                        <div class="float-right">
                        <a class="btn btn-sm" href="{:U('Item/jiesuan', array('id' => $vo['gid'], 'od' => $vo['id'], 'f' => 'car') )}" >购买</a>
                        <button class="btn btn-sm btn_del" data="{$vo.id}">删除</button>
                        </div>
                    </span>
                </div>
            </volist>
        </div>
    </div>

	<script>
	$(function(){
		$('.btn_del').click(function(){
			var id = parseInt($(this).attr('data'));
			if(id>0 && typeof(id)=='number'){
				$.post(
					"{:U('User/cars_del')}",
					{id:id},
					function(ref){
						ref = eval("("+ref+")");
						alert(ref.msg);
						if(ref.status){
//							location.reload();
						}
					}
				);
			}else{
				alert('请确认提供的数据的准确性！');
			}
		})
	})
	</script>
</body>
</html>